// KafkaConfig.cs
using System.Collections.Generic;

namespace Beauty.Net.Kafka
{
    /// <summary>
    /// Kafka 配置类
    /// </summary>
    public class KafkaConfig
    {
        /// <summary>
        /// Bootstrap 服务器地址
        /// </summary>
        public string BootstrapServers { get; set; } = string.Empty;

        /// <summary>
        /// 消费者组ID
        /// </summary>
        public string GroupId { get; set; } = string.Empty;

        /// <summary>
        /// 是否自动提交偏移量
        /// </summary>
        public bool EnableAutoCommit { get; set; } = true;

        /// <summary>
        /// 自动提交间隔
        /// </summary>
        public int AutoCommitIntervalMs { get; set; } = 5000;

        /// <summary>
        /// 会话超时时间
        /// </summary>
        public int SessionTimeoutMs { get; set; } = 30000;

        /// <summary>
        /// 自动偏移重置策略
        /// </summary>
        public string AutoOffsetReset { get; set; } = "earliest";

        /// <summary>
        /// 安全协议
        /// </summary>
        public string? SecurityProtocol { get; set; }

        /// <summary>
        /// SASL机制
        /// </summary>
        public string? SaslMechanism { get; set; }

        /// <summary>
        /// SASL用户名
        /// </summary>
        public string? SaslUsername { get; set; }

        /// <summary>
        /// SASL密码
        /// </summary>
        public string? SaslPassword { get; set; }

        /// <summary>
        /// 生产者额外配置
        /// </summary>
        public Dictionary<string, string> ProducerConfig { get; set; } = new Dictionary<string, string>();

        /// <summary>
        /// 消费者额外配置
        /// </summary>
        public Dictionary<string, string> ConsumerConfig { get; set; } = new Dictionary<string, string>();
    }
}
